<extend name="Public/base" />

<block name="body">
  <!-- 标题栏 -->
  <div class="main-title">
    <h2>老客户立减管理</h2>
  </div>
  <div class="cf">
    <div class="fl">
      <a class="btn" href="{:U('index')}">刷 新 <span style="font-size:12px;font-weight:normal">(清空搜索条件)</span></a>
    </div>
    
    <!-- 高级搜索 -->
   <form id="J_search_form" action="{:U('index')}" method="GET">
      <div class="search-form fr cf">
        <div class="fl">
          <div class="sleft">
              <input type="text" name="store" class="search-input w-150" value="{:I('store')}" placeholder="店铺名称">
          </div>
          <div class="sleft">
            <input type="text" name="keywords" class="search-input" value="{:I('get.keywords')}" placeholder="商品ID、名称"/>
            <a class="sch-btn" href="javascript:;" id="J_search"><i class="btn-search"></i></a>
          </div>
        </div>
      </div>
    </form>
  </div>
  <!-- 数据列表 -->
  <div class="data-table table-striped">
    <table class="">
      <thead>
        <tr>
          <!-- <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th> -->
          <th width="100">商品ID</th>
          <th>商品</th>
          <th>原价格</th>
          <th>优惠金额</th>
          <th>优惠后价格</th>
          <th>活动来源</th>
          <th>状态</th>
          <th width="140" class="text-center">操作</th>
        </tr>
      </thead>
      <tbody>
      <notempty name="lists">
        <volist name="lists" id="vo">
          <tr class="status_trclass_{$vo.status}">
            <!-- <td><input class="ids" type="checkbox" name="ids[]" value="{$vo.id}" /></td> -->
            <td><a href="{:U('/Item/detail?id='.$vo['item_id'])}" target="_blank">{$vo.item_info.id}</a></td>
            <td>
              <eq name="vo.store_id" value="0">
                <a href="{:U('/Item/detail?id='.$vo['item_id'])}" target="_blank"><img src="{$vo.item_info.thumb}" width="32"/></a>
                <a href="{:U('edit?id='.$vo['id'])}">{$vo.item_info.name}</a>
              <else />
                <img src="{$vo.item_info.thumb}" width="32"/>{$vo.item_info.name}
              </eq>
            </td>
            <td><span class="text-danger">{$vo.item_info.price}</span> 元</td>
            <td><span class="text-danger">{$vo.dis_price}</span> 元</td>
            <td><span class="text-danger">{$vo.buy_price}</span> 元</td>
            <td><gt name="member_id" value="0"><a href="{:U('Store/detail?member_id='.$member_id)}">{:store_name($vo['store_id'])}</a><else />{:store_name($vo['store_id'])}</gt></td>
            <td>{$vo.status_text}</td>
            <td class="text-center">
              <eq name="vo.status" value="1">
                <eq name="vo.store_id" value="0"><a href="{:U('setStatus?status=0&ids='.$vo['id'])}" class="ajax-get">[禁用]</a><else /><span class="disabled">[禁用]</span></eq>
              <else/>
                <eq name="vo.store_id" value="0"><a href="{:U('setStatus?status=1&ids='.$vo['id'])}" class="ajax-get">[启用]</a><else /><span class="disabled">[启用]</span></eq>
              </eq>
              <eq name="vo.store_id" value="0"><a href="{:U('edit?id='.$vo['id'])}">[编辑]</a><else /><span class="disabled">[编辑]</span></eq>
              <eq name="vo.store_id" value="0"><a href="{:U('setStatus?status=-1&ids='.$vo['id'])}" class="confirm ajax-get">[删除]</a><else /><span class="disabled">[删除]</span></eq>
            </td>
          </tr>
        </volist>
        <else/>
        <td colspan="12" class="text-center"> aOh! 暂时还没有内容! </td>
      </notempty>
      </tbody>
    </table>

  </div>
  <div class="page">
    {$_page}
  </div>
</block>

<block name="script">
    <script type="text/javascript">
        $(function(){
            //回车自动提交
            $('.search-form').find('input').keyup(function(event){
                if(event.keyCode===13){
                    $("#search").click();
                }
            });
            //导航高亮
            highlight_subnav("{:U('index')}");
        });
    </script>
</block>
